package cn.kgc.util.desensitization;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @author YC
 */
@JacksonAnnotationsInside
@JsonSerialize(using = SensitiveInfoSerializer.class)
@Target({ElementType.FIELD})
@Retention(RetentionPolicy.RUNTIME)
public @interface Desensitization {


    /**
     * 脱敏数据类型
     */
    DesensitizationType type();

    /**
     * 被脱敏数据前位不脱敏字符长度
     */
    int prefixLength() default 0;

    /**
     * 被脱敏数据后位不脱敏字符长度
     */
    int suffixLength() default 0;

}
